<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <title>用户注册</title>
    <link rel="stylesheet" href="../css/login.css" type="text/css">
    <style>
        .message {
            padding: 10px;
            margin: 10px 0;
            border-radius: 4px;
            text-align: center;
        }
        .error-message {
            background-color: #ffebee;
            color: #c62828;
            border: 1px solid #ef5350;
        }
    </style>
</head>
<body>
    <div class="container">
        <h2>用户注册</h2>
        
        <% if (request.getAttribute("errorMessage") != null) { %>
            <div class="message error-message">
                <%= request.getAttribute("errorMessage") %>
            </div>
        <% } %>
        
        <form action="register" method="post">
            <div class="form-group">
                <label for="username">用户名:</label>
                <input type="text" id="username" name="username" required>
            </div>
            
            <div class="form-group">
                <label for="password">密码:</label>
                <input type="password" id="password" name="password" required>
            </div>
            
            <div class="form-group">
                <label for="securityQuestion">安全问题:</label>
                <select id="securityQuestion" name="securityQuestion" required>
                    <option value="">请选择安全问题</option>
                    <option value="你父亲的名字是？">你父亲的名字是？</option>
                    <option value="你母亲的名字是？">你母亲的名字是？</option>
                    <option value="你的出生地是？">你的出生地是？</option>
                    <option value="你最喜欢的颜色是？">你最喜欢的颜色是？</option>
                    <option value="你的小学名字是？">你的小学名字是？</option>
                </select>
            </div>
            
            <div class="form-group">
                <label for="securityAnswer">安全答案:</label>
                <textarea id="securityAnswer" name="securityAnswer" required></textarea>
            </div>
            
            <button type="submit" class="btn">注册</button>
        </form>
        
        <div class="login-link">
            <p>已经有账户了？<a href="login.jsp">立即登录</a></p>
        </div>
    </div>
</body>
</html>

